<?php
namespace app\common\loglic;

class Attr
{
    //状态
    public function status()
    {
        return [
            'normal'  => '显示',
            'hidden'  => '隐藏',
        ];
    }

    //状态的KEY
    public function statusKeys()
    {
        return array_keys($this->status());
    }

    //布尔
    public function bool()
    {
        return [
            0 => '否',
            1 => '是',
        ];
    }

    //开关
    public function onoff()
    {
        return [
            0  => '关闭',
            1  => '开启',
        ];
    }

    //开关
    public function group($isFirst=true)
    {
        $result = [
            1  => '分组1',
            2  => '分组2',
            3  => '分组3',
            4  => '分组4',
            5  => '分组5',
            6  => '分组6',
            7  => '分组7',
            8  => '分组8',
            9  => '分组9',
        ];
        if($isFirst){
            $result[0] = '-----';
        }
        return $result;
    }

    //打开方式
    public function target()
    {
        return [
            '_self'   => '同窗口',
            '_blank'  => '新窗口',
            '_parent' => '父窗口',
            '_top'    => '顶层窗品',
            '_new'    => '新标签页',
        ];
    }

    //常用星级
    public function weight()
    {
        return [
            1 => '★',
            2 => '★★',
            3 => '★★★',
            4 => '★★★★',
            5 => '★★★★★',
        ];
    }
}